package com.rover.service.system;

import org.hibernate.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.rover.dao.BaseDao;
import com.rover.entity.system.User;
import com.rover.entity.system.UserRole;

@Service("userRoleService")
@Transactional
public class UserRoleService {

	@Autowired
	private BaseDao<UserRole> userRoleDao;

	@Transactional
	public void deleteRoles(User user) {
		Query q = userRoleDao.getCurrentSession().createQuery(
				"delete from UserRole where tuser=:tuser");
		q.setParameter("tuser", user);
		q.executeUpdate();
		
	}
}
